{extend name="./tpl/default/mobile/public/layout.html" /}
{block name="header"}
<link rel="stylesheet" href="/public/home/mobile/css/guanjian/anli.css">
<link rel="stylesheet" href="/public/home/mobile/css/guanjian/gonglv.css">
<link rel="stylesheet" href="/public/plugins/dropload/dropload.css">
<style>
    .am-header-default{
        background-color: #fff;
    }
</style>
{/block}
{block name="head"}
<header data-am-widget="header"
        class="am-header am-header-default">
    <div class="am-header-left am-header-nav" onclick="history.back(-1)">
        <span class="icon iconfont icon-xiangzuojiantou" style="color: #989898;"></span>
    </div>

    <h1 class="am-header-title" style="color:#424242;">
        客户案例
    </h1>

    <div class="am-header-right am-header-nav">
        <a href="{:url('search')}"><span class="icon iconfont icon-sousuo" style="color: #989898;"></span></a>
    </div>
</header>
{/block}
{block name="body"}
<div class="gonglv_box">
    <hr style="border:1px solid #e0e0e0;margin: 0px;">
    <div class="gonglv_list" id="list">

    </div>
    <div id="page"></div>
</div>
{/block}
{block name="script"}
<script src="/public/plugins/template/template.js"></script>
<script src="/public/plugins/dropload/dropload.min.js"></script>
<script type="text/html" id="list-tpl">
    {{ each data as value index}}
    <div class="am-g" style="border-bottom:1px solid #d1d1d1;margin-bottom: 10px;padding: 10px;">
        <div class="am-u-sm-4">
            <a href="{{ value.url}}">
                <img src="{{ value.thumb}}" alt="{{ value.title}}" style="width:25vw;height: 22vw;"/>
            </a>
        </div>
        <div class="am-u-sm-8" style="padding-top: 20px;">
            <div class="am-g">
                <div class="am-u-sm-12" style="overflow: hidden;
                                                  white-space: nowrap;
                                                  text-overflow: ellipsis;">
                    <a href="{{ value.url}}">
                        <h3 style="margin: 0px;">{{ value.title}}</h3>
                    </a>
                </div>
                <div class="am-u-sm-12" style="overflow: hidden;
                                                  white-space: nowrap;
                                                  text-overflow: ellipsis;">
                    <div class="am-u-sm-12">
                        <a href="{{ value.url}}">{{ value.create_time_text}}</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {{ /each}}
</script>
<script>
    var page = 1;
    $('#page').dropload({
        scrollArea: window,
        loadDownFn: function (me) {
            $.ajax({
                data: {page: page, cid: '{$currentCat.cid}'},
                url: '{:url("/home/Cms/itemList")}',
                success: function (data) {
                    if (data.code === 0) {
                        layer.open({
                            content: data.msg
                            , skin: 'msg'
                            , time: 2 //2秒后自动关闭
                        });
                        me.noData();
                        me.lock();

                    } else {
                        page++;
                        if (page > data.last_page) {
                            me.noData();
                            me.lock();
                        }
                        var html = template('list-tpl', data);
                        $('#list').append(html);
                    }
                    me.resetload();
                },
            });
        }
    });
</script>
{/block}
